
#include <iostream>
#include <cstdio>
#include <unistd.h>
#include "ThreadPool.h"
#include "Task.h"

int main()
{
    auto p_tp1 = zmh::ThreadPool<Task>::GetHandler(5);
    auto p_tp2 = zmh::ThreadPool<Task>::GetHandler(5);
    auto p_tp3 = zmh::ThreadPool<Task>::GetHandler(5);
    auto p_tp4 = zmh::ThreadPool<Task>::GetHandler(5);
    LOG(zmh::DEBUG) << p_tp1;
    LOG(zmh::DEBUG) << p_tp2;
    LOG(zmh::DEBUG) << p_tp3;
    LOG(zmh::DEBUG) << p_tp4;

    p_tp1->Start();

    int count = 1;
    while (count <= 10)
    {
        p_tp1->Enqueue(Task(count++));
        sleep(1);
    }

    p_tp1->Stop();
}
